import java.lang.reflect.*;

public class ReflectionTest {

	public void hello(String name) {
		System.out.println("Hello " + name + "!");
	}
	
	public void greet() {
		System.out.println("Hello world!");
	}
	
	public static void main(String[] args) throws Exception {

		Class c = Class.forName("ReflectionTest");
		Class[] paramTypes = new Class[1];
		paramTypes[0] = String.class;
		Method methodHello = c.getMethod("hello", paramTypes);
		ReflectionTest test = new ReflectionTest();
		Object[] argList = new Object[1];
		argList[0] = "Heonkoo";
		methodHello.invoke(test, argList);	
		
		Method methodGreet = c.getMethod("greet", null);
		methodGreet.invoke(test, null);
		
	}

}

